<!DOCTYPE html>
<html lang="en">

<head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <!-- Bootstrap CSS -->
    <style>
        .bg-f2 {
            background-color: #f8f9fa;
        }

        video {
            width: 320px;
            height: auto;
        }

        .videoRow {
            margin-top: 30px;
        }

        #previewLabel {
            display: block;
            position: absolute;
        }
    </style>
    <title>datachannel</title>
</head>

<body class="bg-f2">

<div class="container">

    <div class="my-3 p-3 bg-white rounded box-shadow small">

        <h6 class="border-bottom border-gray pb-2 mb-0">datachannel</h6>

        <div class="row" style="margin-top:1%">

            <div class="col-sm">
                <div class="input-group input-group-sm mb-3">
                    <div class="input-group-prepend">
                        <label class="input-group-text" for="roomId"><strong class="text-gray-dark roomid">房间号</strong></label>
                    </div>
                    <input type="email" class="form-control d-inline" id="roomId" style="width: 50%"
                           aria-describedby="emailHelp" placeholder="please enter room ID">
                </div>
            </div>

            <div class="col-sm">
              <div class="input-group input-group-sm mb-3">
                  <div class="input-group-prepend">
                      <label class="input-group-text" for="pubChannelID"><strong class="text-gray-dark">广播频道</strong></label>
                  </div>
                  <input type="email" class="form-control d-inline" id="pubChannelID" style="width: 50%"
                         aria-describedby="emailHelp" placeholder="please enter channel ID">
              </div>
            </div>

            <div class="col-sm">
              <div class="input-group input-group-sm mb-3">
                  <div class="input-group-prepend">
                      <label class="input-group-text" for="subChannelID"><strong class="text-gray-dark">订阅频道</strong></label>
                  </div>
                  <input type="email" class="form-control d-inline" id="subChannelID" style="width: 50%"
                         aria-describedby="emailHelp" placeholder="please enter channel ID">
              </div>
            </div>

            </div>
        </div>

        <div class="row">
            <div class="col-sm">
                <button type="button" id="createRoom" class="btn btn-primary btn-sm">进入房间(推流)</button>
                <button type="button" id="openRoom" class="btn btn-primary btn-sm">进入房间(不推流)</button>
                <button type="button" id="leaveRoom" class="btn btn-secondary btn-sm">退出</button>
                <button type="button" id="preAndPub" class="btn btn-secondary btn-sm" disabled>预览并推流</button>
                <button type="button" id="startBroadcasting" class="btn btn-primary btn-sm">开始广播</button>
                <button type="button" id="startSubscribing" class="btn btn-primary btn-sm">开始订阅</button>
                <button type="button" id="stopBroadcasting" class="btn btn-primary btn-sm">停止广播</button>
                <button type="button" id="stopSubscribing" class="btn btn-primary btn-sm">停止订阅</button>
                <button type="button" id="sendMessage" class="btn btn-primary btn-sm">发送消息</button>
            </div>
        </div>

        <div class="row videoRow">
            <div class="col-sm">
                <label id="previewLabel" class="text-white"></label>
                <video id="previewVideo" autoplay muted playsinline></video>
            </div>
            <div class="col-sm remoteVideo">
                <!-- <video  autoplay muted playsinline></video> -->
            </div>
        </div>
    </div>

    <div class="toast fade hide" role="alert" aria-live="assertive" aria-atomic="true" id="toast">
      <div class="toast-body" id="toastBody">

      </div>
    </div>

</div>

<!-- Button trigger modal -->

<script type="text/javascript" src="../datachannel/datachannel.bundle.js"></script></body>
</html>
